package com.moyq5.mvc.maker.test.bean.entity;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;

import org.hibernate.annotations.DynamicUpdate;
import org.hibernate.annotations.GenericGenerator;

import com.moyq5.mvc.maker.test.bean.enums.AdminType;

/**
 * 角色
 * @author Moyq5
 * @date 2018年4月13日
 */
@Entity
@Table(name = "sys_role")
@DynamicUpdate
public class SysRole implements java.io.Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = -7529228660066507296L;
	/**
	 * 角色ID
	 */
	@Id
    @GeneratedValue(strategy = GenerationType.AUTO, generator = "native")@GenericGenerator(name = "native", strategy = "native")
    @Column(name = "role_id")
	private Long roleId;
	/**
	 * 角色名称
	 */
	@Column(name = "name", length = 60, nullable = false)
	private String name;
	/**
	 * 角色类型
	 */
    @Enumerated(EnumType.ORDINAL)
    @Column(name = "admin_type", precision = 2, nullable = false)
	private AdminType adminType;
	public Long getRoleId() {
		return roleId;
	}
	public void setRoleId(Long roleId) {
		this.roleId = roleId;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public AdminType getAdminType() {
		return adminType;
	}
	public void setAdminType(AdminType adminType) {
		this.adminType = adminType;
	}
}
